<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新网</title>
<link href="${rc.contextPath}/common/css/common/common.css"rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/jquery.js"></script>
<script type="text/ecmascript" src="${rc.contextPath}/common/js/javascript.js"></script>

</head>
<body style="overflow-x:hidden;">
<input type="hidden" id="rootPath" value="${rc.contextPath}"/>
<div class="sideMenue">
  <div class="sm">
    <div class="tit"><strong>快捷入口</strong></div>
    <div class="con">
<div class="trees">
	<div id="customManage" style="display: block;" ></div>
	<div id="serviceManage" style="display: none;" ></div>
	<div id="authorityManage" style="display: none;"></div>
	<div id="ruleSet" style="display: none;"></div>
	<div id="massagePublish" style="display: none;"></div>
</div>       
<script type="text/javascript">

 function getParentNodeHtml(menuTree,html){
     for(var nodeName in menuTree){ 
    	
     	var value = menuTree[nodeName];
     	var isParentNode = menuTree[nodeName] instanceof Object;
     	if(isParentNode){
     		html=html+"<h4>"+nodeName+"</h4><div class='tre'><ul>";
     		var html = html+getParentNodeHtml(value[0],"");
     		html=html+"</ul></div>";
     	}else{
     		html=html+"<li class='sc'><a href='${rc.contextPath}"+menuTree[nodeName]+"'	target='mainFrame'>"+nodeName+"</a></li>";	
     	}
     }
    return html;
}
 
 
 function getMenuTree(url,treeIds,divIds){
	 var divIdArray = divIds.split(",");
	  $.ajax({
		    type: "GET",
		    url:url,
		    async: false,
		    data:"treeIds="+treeIds,
		    success: function(menuTreeList){
		    	
		    	for(var i=0;i<menuTreeList.length;i++){
			    	var menuTree = menuTreeList[i][0];
			    	var parentNode = new Object();
			    	var leafNode = new Object();
			    	for(var nodeName in menuTree){ 
			         	var value = menuTree[nodeName];
			         	var isParentNode = menuTree[nodeName] instanceof Object;
			         	if(isParentNode){
			         		parentNode[nodeName]=value;
			         	}else{
			         		leafNode[nodeName]=value;
			         	}
			    	}
			    	var html=""
			    	html=html+ getParentNodeHtml(parentNode,"");
			    	for(var nodeName in leafNode){
			    		if(nodeName!='客户调配'){
			    			html=html+"<li class='sc'><a href='${rc.contextPath}"+leafNode[nodeName]+"' target='mainFrame'>"+nodeName+"</a></li>";
			    		}
			    		
			    	}
		    		$("#"+divIdArray[i]).empty();
		    		$("#"+divIdArray[i]).append(html);
		    	}
		    	
		    	
		    },
		    error: function(request) {
		        alert("Connection ERROR OR SESSION IS TIMEOUT");
		    }
		}); 
 }
 
 getMenuTree("${rc.contextPath}/resources/getResourcesList","1,86,2,3,4","customManage,serviceManage,authorityManage,ruleSet,massagePublish");
 
</script>
    
  </div>
</div>
</body>
</html>
